import express, { Router } from 'express'
import * as userController from './user.controller'
import {
  validateUser,
  hashPassword,
  validateUpdateUserData
} from './user.middleware'
import { authGuard } from '../auth/auth.middleware'

const router: Router = express.Router()

router.post('/user', validateUser, hashPassword, userController.store)
router.get('/user/:userId', userController.show)
router.patch('/user', authGuard, validateUpdateUserData, userController.update)

export default router
